class StoreAdjustSalaryLog < ApplicationRecord
  include FormatTime

  belongs_to :store_staff
  belongs_to :store
  belongs_to :creator, class_name: "StoreStaff", foreign_key: 'creator_id'

  scope :by_month, ->(month = Time.now) { where(created_at: month.beginning_of_month .. month.end_of_month) }

  def creator_name
    creator.full_name
  end
end
